/* Custom styles for Nokia-like monochrome pixelated look (brighter version) */
/* ===== Colours: day and night palettes (swap by changing these) ===== */
:root {
    --bg: #8CA17C;        /* page + card background */
    --ink: #000000;       /* text, borders, filled buttons */
    --on-ink: #D0E0C0;    /* text on top of filled (ink) things */
    --panel: #7A8C70;     /* header, footer, hover fills */
    --ink-hover: #333333; /* filled buttons on hover */
    --muted: rgba(0, 0, 0, 0.55);
}

:root[data-theme="dark"] {
    --bg: #0F380F;
    --ink: #9BBC0F;
    --on-ink: #0F380F;
    --panel: #306230;
    --ink-hover: #7C9A0C;
    --muted: rgba(155, 188, 15, 0.55);
}

body {
    font-family: 'Inter', sans-serif; /* Changed for better readability */
    background-color: var(--bg); /* Brighter muted green background */
    color: var(--ink); /* Black text */
    image-rendering: pixelated; /* Ensure pixelation for all elements */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pixel-font {
    font-family: 'Press Start 2P', cursive; /* Keeping this for titles/buttons for strong pixel effect */
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25); /* Pixel drop shadow */
    text-transform: uppercase; /* All uppercase for consistency */
    letter-spacing: 0; /* No extra letter spacing */
    text-align: center; /* Center alignment for titles */
}

.pixel-border {
    border: 2px solid var(--ink); /* Black border */
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25); /* Pixel drop shadow */
}

.pixel-button {
    background-color: var(--ink); /* Black background */
    color: var(--on-ink); /* Brighter green text */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 0; /* No rounded corners */
    font-weight: bold;
    font-size: 0.875rem; /* text-sm */
    border: 1px solid var(--ink); /* Subtle border for button */
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25); /* Pixel drop shadow */
    transition: all 0.05s ease-in-out;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
}

.pixel-button:hover {
    background-color: var(--ink-hover); /* Slightly lighter black on hover */
    color: var(--on-ink); /* Even brighter green on hover */
    transform: translate(0px, 0px); /* No movement on hover */
    box-shadow: none; /* No shadow on hover to simulate press */
}

.pixel-card {
    background-color: var(--bg); /* Brighter muted green for card background (matches body) */
    border: 2px solid var(--ink); /* Black border */
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25); /* Pixel drop shadow */
    border-radius: 0; /* Sharp corners */
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    height: auto; /* Allow height to adjust for content */
    overflow: visible; /* Ensure content is not hidden by card itself */
    display: flex; /* Make the card a flex container */
    flex-direction: column; /* Stack items vertically */
    justify-content: space-between; /* Distribute space between items (pushes last item to bottom) */
}

.pixel-card h3 {
    color: var(--ink); /* Black text for card content */
    text-align: left; /* Adjust text alignment for readability within cards */
}

.pixel-card p {
    font-family: 'Inter', sans-serif; /* Changed for better readability in summaries */
    color: var(--ink); /* Black text for card content */
    text-align: left; /* Adjust text alignment for readability within cards */
    flex-grow: 1; /* Allow paragraph to take available space and push button down */
    overflow: hidden; /* Hide overflowing text within the paragraph */
    text-overflow: ellipsis; /* Add ellipsis for overflowing text */
    display: -webkit-box; /* For multi-line ellipsis */
    -webkit-line-clamp: 4; /* Limit to 4 lines before ellipsis (adjust as needed) */
    line-clamp: 4; /* Standard property for compatibility */
    -webkit-box-orient: vertical; /* For multi-line ellipsis */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .detailed-view {
        padding: 1.5rem; /* Adjust padding for smaller screens */
    }
    .pixel-font {
        font-size: 0.75rem;
    }
    .pixel-card {
        padding: 1rem;
    }
    .main-content {
        flex-direction: column;
    }
}

/* Styling for the detailed news view */
.detailed-view {
    grid-column: 1 / -1; /* Make it span all columns */
    max-width: 800px; /* Constrain width for readability */
    margin-left: auto;
    margin-right: auto;
    padding: 2.5rem; /* More padding for bigger look */
}


/* ===== STEP 2: cleanup and life ===== */

/* News cards: flicker in like an old screen, lift with a hard shadow on hover */
.news-card {
    animation: flicker-in 0.3s steps(3) both;
    animation-delay: calc(var(--i, 0) * 35ms);
    transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
}

@keyframes flicker-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (hover: hover) {
    .news-card:hover {
        transform: translate(-4px, -4px);
        box-shadow: 6px 6px 0 var(--ink);
    }
}

/* Source tag + time ago at the top of each card */
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.time-ago {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: var(--ink);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Blinking cursor for loading and error titles */
.blink::after {
    content: '_';
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Error card */
.error-card {
    align-items: flex-start;
}

.error-detail {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-transform: uppercase;
}

/* Respect people who turn animations off */
@media (prefers-reduced-motion: reduce) {
    .news-card,
    .blink::after {
        animation: none;
    }
    .news-card {
        transition: none;
    }
}
/* ===== Typography: pixel summaries + bigger headlines ===== */
.pixel-card p {
    font-family: 'VT323', monospace;
    font-size: 1.6rem;
    line-height: 1.15;
    -webkit-line-clamp: 5;
    line-clamp: 5;
}

@media (min-width: 769px) {
    .news-card h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
}

/* Headline highlights like a selected menu item */
.news-card h3 {
    align-self: flex-start;
    padding: 0.15rem 0.25rem;
    margin-left: -0.25rem;
    transition: background-color 0.08s steps(2), color 0.08s steps(2);
}

@media (hover: hover) {
    .news-card:hover h3 {
        background-color: var(--ink);
        color: var(--on-ink);
        text-shadow: none;
    }
}


/* ===== STEP 3: category filters with pixel icons ===== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.filter-bar[hidden] {
    display: none;
}

.filter-label {
    flex-basis: 100%;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    text-transform: uppercase;
    margin: 0 0 0.35rem;
}

.filter-button {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0.55rem 0.8rem;
    background-color: transparent;
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: baseline; /* label and number share one baseline */
    gap: 0.55rem;
    transition: background-color 0.08s steps(2), color 0.08s steps(2);
}

.filter-button:hover {
    background-color: var(--panel);
}

.filter-button.is-active {
    background-color: var(--ink);
    color: var(--on-ink);
}

.filter-button:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

.filter-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    align-self: center; /* icon stays centered while text lines up on a baseline */
}

.filter-count {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    line-height: 1;
}

/* Card top row: category tag on the left, time on the right */
.card-meta {
    align-items: center;
}

.category-tag {
    border: 2px solid var(--ink);
    color: var(--ink);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 0.3rem 0.5rem;
    text-transform: uppercase;
}

/* Card bottom row: "VIA IGN" on the left, READ MORE on the right */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.card-source {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--ink);
}

@media (max-width: 768px) {
    .filter-button {
        font-size: 0.6rem;
        padding: 0.5rem 0.6rem;
        gap: 0.4rem;
    }
    .filter-icon {
        width: 20px;
        height: 20px;
    }
}


/* ===== STEP 4: tagline under the title ===== */

.tagline {
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    line-height: 1.6;
    text-transform: uppercase;
    color: var(--ink);
    margin: -1rem 0 2rem;
}

@media (max-width: 768px) {
    .tagline {
        font-size: 0.6rem;
        margin-bottom: 1.5rem;
    }
}


/* ===== STEP 5: search + saved stories ===== */

.filter-bar {
    margin-bottom: 1.25rem;
}

/* Search box */
.search-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin: 0 auto 2rem;
    max-width: 34rem;
}

.search-bar[hidden] {
    display: none;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    border: 2px solid var(--ink);
    padding: 0.35rem 0.6rem;
    cursor: text;
    transition: box-shadow 0.08s steps(2), transform 0.08s steps(2);
}

.search-field:focus-within {
    background-color: var(--panel);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--ink);
}

.search-prompt {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--ink);
}

.search-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    font-family: 'VT323', monospace;
    font-size: 1.6rem;
    line-height: 1.2;
    color: var(--ink);
    text-transform: uppercase;
}

.search-input::placeholder {
    color: var(--muted);
}

.search-clear {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    background-color: var(--ink);
    color: var(--on-ink);
    border: 0;
    padding: 0.45rem 0.55rem;
    cursor: pointer;
}

.search-clear[hidden] {
    display: none;
}

.search-clear:hover {
    background-color: var(--ink-hover);
}

.search-status {
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    line-height: 1;
    min-height: 1.3rem;
    color: var(--ink);
}

/* No flicker-in while typing or un-saving */
.no-anim .news-card {
    animation: none;
}

/* Heart (save) button in the card's top row */
.card-meta-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    background: transparent;
    border: 0;
    color: var(--ink);
    cursor: pointer;
    transition: background-color 0.08s steps(2);
}

.save-button:hover {
    background-color: var(--panel);
}

.save-button:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

.save-icon {
    width: 24px;
    height: 24px;
}

/* Empty states (no results, nothing saved) */
.empty-card {
    align-items: flex-start;
}

@media (max-width: 768px) {
    .search-input {
        font-size: 1.4rem;
    }
}


/* ===== STEP 6: header, footer, night toggle ===== */

.site-header,
.site-footer {
    background-color: var(--panel);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 0.5rem 0.7rem;
    background-color: transparent;
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.08s steps(2), color 0.08s steps(2);
}

.theme-toggle:hover {
    background-color: var(--ink);
    color: var(--on-ink);
}

.theme-toggle:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

.theme-icon {
    width: 20px;
    height: 20px;
}

.social-link {
    color: var(--ink);
    display: inline-flex;
    transition: color 0.08s steps(2);
}

.social-link:hover {
    color: var(--ink-hover);
}

.social-icon {
    width: 24px;
    height: 24px;
}


/* ===== STEP 7: top story + tidy headlines ===== */

.card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

/* Long headlines stop at 6 lines instead of stretching the card */
.news-card h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    overflow: hidden;
}

/* The big top story: colours flipped, like an inverted Game Boy screen */
.featured-card {
    background-color: var(--ink);
    color: var(--on-ink);
    border-color: var(--ink);
}

.featured-card h3,
.featured-card p,
.featured-card .time-ago,
.featured-card .card-source,
.featured-card .save-button {
    color: var(--on-ink);
}

.featured-card h3 {
    font-size: 1.1rem;
    line-height: 1.5;
    -webkit-line-clamp: 5;
    line-clamp: 5;
}

.featured-card p {
    font-size: 1.7rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.featured-card .category-tag {
    border-color: var(--on-ink);
    color: var(--on-ink);
}

.featured-badge {
    background-color: var(--on-ink);
    color: var(--ink);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 0.3rem 0.5rem;
    border: 2px solid var(--on-ink);
    text-transform: uppercase;
}

.featured-card .pixel-button {
    background-color: var(--on-ink);
    color: var(--ink);
    border-color: var(--on-ink);
}

.featured-card .pixel-button:hover {
    background-color: var(--panel);
    color: var(--on-ink);
}

.featured-card .save-button:hover {
    background-color: var(--ink-hover);
}

@media (hover: hover) {
    .news-card.featured-card:hover h3 {
        background-color: var(--on-ink);
        color: var(--ink);
    }
}

@media (min-width: 769px) {
    .featured-card {
        padding: 2rem;
    }
    .news-card.featured-card h3 {
        font-size: 1.75rem;
        line-height: 1.4;
    }
}


/* ===== STEP 8: phone polish ===== */

.pixel-button {
    white-space: nowrap;
}

/* filter row: label on top, buttons underneath */
.filter-bar {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.6rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.featured-card .card-meta {
    margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
    /* one tidy scrolling row of buttons instead of three rows */
    .filter-buttons {
        flex-wrap: nowrap;
        justify-content: flex-start;
        justify-content: safe center;
        width: 100%;
        overflow-x: auto;
        padding: 0.2rem 0.2rem 0.7rem;
        scrollbar-width: thin;
        scrollbar-color: var(--ink) transparent;
        -webkit-overflow-scrolling: touch;
    }

    .filter-button {
        flex-shrink: 0;
    }

    /* header: keep the logo on one line */
    .site-header a.pixel-font {
        font-size: 1rem;
        white-space: nowrap;
        padding-left: 0;
    }

    .theme-toggle {
        padding: 0.45rem 0.55rem;
    }

    /* card bottom row: source can wrap, button never does */
    .card-footer {
        gap: 0.5rem;
    }

    .card-source {
        font-size: 0.55rem;
        line-height: 1.5;
        min-width: 0;
    }

    .pixel-button {
        font-size: 0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}


/* ===== STEP 9: load more ===== */

.load-more {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.load-more-button {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.85rem;
    padding: 0.9rem 1.6rem;
    cursor: pointer;
}

.load-more-count {
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    line-height: 1;
    text-transform: uppercase;
}

.load-more-button:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}


/* ===== STEP 10: new tagline text, description, back-to-top button ===== */

.tagline {
    margin-bottom: 0.6rem;
}

.tagline-desc {
    max-width: 38rem;
    margin: 0 auto 2rem;
    text-align: center;
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    line-height: 1.15;
    color: var(--ink);
}

.back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background-color: var(--ink);
    color: var(--on-ink);
    border: 2px solid var(--ink);
    border-radius: 0;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.12s steps(3), transform 0.12s steps(3), visibility 0.12s;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-to-top:hover {
    background-color: var(--ink-hover);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

.back-to-top-icon {
    width: 28px;
    height: 28px;
}

@media (max-width: 768px) {
    .tagline-desc {
        font-size: 1.35rem;
    }

    .back-to-top {
        width: 44px;
        height: 44px;
        right: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
}


/* ===== STEP 11: credits-screen footer ===== */

.site-footer {
    position: relative;
}

/* dashed pixel edge above the footer */
.site-footer::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 16px);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.footer-text {
    flex: 1 1 18rem;
    min-width: 0;
}

.footer-credits {
    font-family: 'VT323', monospace;
    font-size: 1.8rem;
    line-height: 1.1;
    max-width: 40rem;
    color: var(--ink);
}

.footer-made {
    margin-top: 0.9rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--ink);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.85rem 1.05rem;
    color: var(--ink);
    border: 2px solid var(--ink);
    transition: background-color 0.08s steps(2), color 0.08s steps(2);
}

.footer-link:hover {
    background-color: var(--ink);
    color: var(--on-ink);
}

.footer-link:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .footer-links {
        width: 100%;
    }

    .footer-credits {
        font-size: 1.55rem;
    }

    .footer-made {
        font-size: 0.75rem;
    }

    .footer-link {
        flex: 1 1 0;
        font-size: 0.65rem;
        padding: 0.8rem 0.3rem;
    }
}


/* ===== STEP 12: signboard nav bar ===== */

.site-nav {
    padding-top: 1.1rem;
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.sign-wrap {
    position: relative;
}

.sign {
    position: relative;
    display: block;
    padding: 4px;
    background-color: var(--bg);
    color: var(--ink);
    border: 3px solid var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    text-decoration: none;
}

.sign-inner {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1.2rem;
    border: 2px solid var(--ink);
}

.sign-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.15rem;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.rivet {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: var(--ink);
}

.rivet-tl { top: 3px; left: 3px; }
.rivet-tr { top: 3px; right: 3px; }
.rivet-bl { bottom: 3px; left: 3px; }
.rivet-br { bottom: 3px; right: 3px; }

.post {
    position: absolute;
    top: 100%;
    width: 6px;
    height: 16px;
    background-color: var(--ink);
}

.post-left { left: 30px; }
.post-right { right: 30px; }

.sign:hover .sign-inner {
    background-color: var(--ink);
    color: var(--bg);
}

.sign:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 4px;
}

/* the checkered ground the sign stands on */
.ground {
    height: 8px;
    margin-top: 16px;
    background:
        repeating-linear-gradient(90deg, var(--ink) 0 4px, transparent 4px 8px) top / 100% 4px no-repeat,
        repeating-linear-gradient(90deg, transparent 0 4px, var(--ink) 4px 8px) bottom / 100% 4px no-repeat;
}

@media (max-width: 768px) {
    .nav-row {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sign-inner {
        gap: 0.55rem;
        padding: 0.55rem 0.8rem;
    }

    .sign-title {
        font-size: 0.85rem;
    }

    .logo-icon {
        width: 22px;
        height: 22px;
    }

    .post-left { left: 22px; }
    .post-right { right: 22px; }
}


/* ===== STEP 13: loading placeholders ===== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 16rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: var(--bg);
    border: 2px solid var(--ink);
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.25);
}

.skeleton-wide {
    grid-column: 1 / -1;
    min-height: 14rem;
}

.sk {
    display: block;
    background-color: var(--ink);
    opacity: 0.16;
    animation: sk-blink 1.2s steps(2) infinite;
}

.sk-tag { width: 5.5rem; height: 1.5rem; }
.sk-title { width: 92%; height: 1.4rem; }
.sk-title.short { width: 62%; }
.sk-line { width: 100%; height: 0.9rem; }
.sk-line.short { width: 70%; }
.sk-btn { width: 8rem; height: 2.5rem; margin-left: auto; margin-top: auto; }

.skeleton-card:nth-of-type(even) .sk { animation-delay: 0.3s; }
.skeleton-card:nth-of-type(3n) .sk { animation-delay: 0.6s; }

@keyframes sk-blink {
    0%   { opacity: 0.12; }
    50%  { opacity: 0.3; }
}

@media (max-width: 768px) {
    .skeleton-extra {
        display: none;
    }

    .skeleton-card {
        min-height: 13rem;
        padding: 1.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sk {
        animation: none;
        opacity: 0.2;
    }
}


/* ===== PHONE FIRST SCREEN: tighter top area ===== */
@media (max-width: 768px) {
    .site-nav {
        padding-top: 0.5rem;
    }

    .post {
        height: 10px;
    }

    .ground {
        margin-top: 10px;
    }

    main.flex-grow {
        padding-top: 0.9rem;
    }

    main section.mb-12 {
        margin-bottom: 1.5rem;
    }

    main h2.pixel-font {
        font-size: 1.05rem;
        line-height: 1.2;
        margin-bottom: 0.7rem;
    }

    .tagline {
        font-size: 0.55rem;
        margin: 0 0 0.4rem;
    }

    .tagline-desc {
        font-size: 1.1rem;
        line-height: 1.1;
        margin-bottom: 0.7rem;
    }

    .filter-label {
        display: none;
    }

    .filter-bar {
        margin-bottom: 0.4rem;
        gap: 0;
    }

    .filter-buttons {
        padding-bottom: 0.45rem;
    }

    .search-bar {
        gap: 0;
        margin-bottom: 0.9rem;
    }
}


/* ===== CARD FOOTER: keep "VIA SOURCE" tidy on mid-size screens ===== */
.card-source {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 769px) and (max-width: 1280px) {
    .card-source {
        font-size: 0.55rem;
    }

    .card-footer .pixel-button {
        font-size: 0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}